import Vue from 'vue'
import VueRouter from 'vue-router'



Vue.use(VueRouter)

const routes = [
  {
    path:'/login',
    name:'login',
    component:()=>import('../views/login.vue')
  },
  {
    path: '/',
    component: () => import('../components/layout.vue'),
    children:[
      {
        path:'',
        redirect:'home',
        meta:{
          hidden:true
        }
      },
      {
        path:'home',
        name:'home',
        component:_=>import('../views/home.vue'),
        meta:{
          title:'主页',
          icon:require('../assets/home.png'),
          icon_act:require('../assets/home (1).png')
        }
      },
      {
        path:'videos',
        name:'videos',
        component:_=>import('../views/videos.vue'),
        meta:{
          title:'视频',
          icon:require('../assets/video.png'),
          icon_act:require('../assets/video (1).png')
        }
      },
      {
        path:'comment',
        name:'comment',
        component:_=>import('../views/comment.vue'),
        meta:{
          title:'评论',
          icon:require('../assets/评论.png'),
          icon_act:require('../assets/评论 (1).png')
        }
      },
      {
        path:'mine',
        name:'mine',
        component:_=>import('../views/mine.vue'),
        meta:{
          title:'我的',
          icon:require('../assets/我的.png'),
          icon_act:require('../assets/我的 (1).png')
        }
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
